import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/blade-activity/activity/list',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const remove = (ids) => {
    return request({
        url: '/api/blade-activity/activity/remove',
        method: 'get',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/blade-activity/activity/addActivity',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/blade-activity/activity/addActivity',
        method: 'post',
        data: row
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/blade-activity/activity/detail',
        method: 'get',
        params: {
            id
        }
    })
}

// export const getSearch = (id) => {
//     return request({
//         url: '/api/blade-activity/activity/search',
//         method: 'get',
//         params: {
//             current,
//             size,
//             name
//         }
//     })
// }
export const getSearch = (current, size, params) => {
    return request({
        url: '/api/blade-activity/activity/search',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getmyList = (activityId) => {
    return request({
        url: '/api/blade-activity/welfareShare/activityListShare',
        method: 'get',
        params: {
            activityId: activityId
        }
    })
}

export const submitShare = (params) => {
    return request({
        url: '/api/blade-activity/welfareShare/submitShare',
        method: 'post',
        data: params
    })
}

export const myremove = (ids) => {
    return request({
        url: '/api/blade-activity/welfareShare/removeShare',
        method: 'get',
        params: {
            ids,
        }
    })
}

export const myremove1 = (ids) => {
    return request({
        url: '/api/blade-activity/welfareShare/removeBuy',
        method: 'get',
        params: {
            ids,
        }
    })
}